package com.yanqu.road.entity.activity.lottery;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@FieldTypeAnnotation(tableName = "t_u_activity_lottery_user_guarantee_data", desc = "通用抽奖每个类型的保底")
public class UserActivityLotteryGuaranteeData extends DataObject {
    @FieldTypeAnnotation(desc = "用户ID", select = true, update = true)
    private long userId;
    @FieldTypeAnnotation(desc = "主活动类型",select = true, update = true)
    private int type;
    @FieldTypeAnnotation(desc = "当前保底次数")
    private int drawCount;
    @FieldTypeAnnotation(desc = "当前已经抽到的物品")
    private Map<Integer, Integer> getItemMap = new HashMap<>();


    public long getUserId() {
        return userId;
    }
    public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setOp(DataStatus.Update);
        }
    }

    public int getType() {
        return type;
    }
    public void setType(int type) {
        if (this.type != type) {
            this.type = type;
            setOp(DataStatus.Update);
        }
    }

    public int getDrawCount() {
        return drawCount;
    }
    public void setDrawCount(int drawCount) {
        if (this.drawCount != drawCount) {
            this.drawCount = drawCount;
            setOp(DataStatus.Update);
        }
    }

    public java.util.Map<java.lang.Integer, java.lang.Integer> getGetItemMap() {
        return getItemMap;
    }

    public void setGetItemMap(java.util.Map<java.lang.Integer, java.lang.Integer> getItemMap) {
        if (null == getItemMap) {
            return;
        }
        this.getItemMap = getItemMap;
        setOp(DataStatus.Update);
    }

    public UserActivityLotteryGuaranteeData(long userId, int type, int drawCount, Map<Integer, Integer> getItemMap) {
        this.userId = userId;
        this.type = type;
        this.drawCount = drawCount;
        this.getItemMap = getItemMap;
        setInsertOption();
    }

    public UserActivityLotteryGuaranteeData() {
    }
}
